<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<script>

$(function () {
    var id=$("#id").val();
    if(id!=null&&id!=""){
        $("#dischargeMethod").attr("disabled",true);
        $("#preDischargeDate").attr("disabled",true);
    }
    //删除按钮
   $("#btnCancel").on("click",function(){
       confirmExtend('确认要删除该出院通知吗？',function(){
           var id=$("#id").val();
           delLoad('rigthDoctorCenterDiv','${ctx}/doctor/preDischgedPats/delete?id='+id,'${ctx}/doctor/preDischgedPats/index?patientId='+$('#patientId').val()+'&visitId='+$('#visitId').val());
       });
   })
});
 </script>
<div class="content-wrap">
    <div class="wrapper" style="bottom: 50px;">
         <section class="panel panel-default">
            <div class="panel-body">
                <div style="width: 100%">
                    <center>
                    <form:form id="inputForm"  data-parsley-validate="" modelAttribute="preDischgedPats" method="post"
                         style="text-align:center;"      class="form-horizontal" onsubmit="return formSaveLoad('rigthDoctorCenterDiv','inputForm','${ctx}/doctor/preDischgedPats/save','${ctx}/doctor/preDischgedPats/index?patientId='+$('#patientId').val()+'&visitId='+$('#visitId').val())">
                        <form:hidden path="id"/>
                        <form:hidden path="patientId"/>
                        <form:hidden path="visitId"/>
                        <div style="float: left;width: 50%;margin-left: 20px;">
                            <div class="form-group" style="margin-top: 10px;">
                                <div class="col-sm-7">
                                    <form:select path="dischargeMethod" itemLabel="label" itemValue="value" class="form-control" data-parsley-required="true">
                                        <form:option value="" label="请选择出院方式"/>
                                        <form:options items="${fns:getDictList('DISCHARGE_DISPOSITION_DICT')}" itemLabel="label"
                                                      itemValue="value" htmlEscape="false" data-parsley-required="true"/>
                                    </form:select>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-7">
                                    <input placeholder="请选择预出院时间" id="preDischargeDate" name="preDischargeDate" class="form-control Wdate" type="text"
                                           onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" required="true" data-parsley-required="true" value="<fmt:formatDate value="${preDischgedPats.preDischargeDate}"  pattern="yyyy-MM-dd"/>"/>
                                </div>
                            </div>
                        </div>
                        <div style="float: left;width: 30%;">
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-7">
                                    <%--<a href="#"--%>
                                       <%--class="btn btn-warning"--%>
                                       <%--onclick="printPresc('${apply.id}','${prescriptionApply.clinicId}','${prescriptionApply.patientId}')">打印</a>--%>
                                    <c:choose>
                                        <c:when test="${preDischgedPats.id==''|| preDischgedPats.id==null}">
                                            <input id="btnSubmit" class="btn btn-primary" type="submit" value="保存">&nbsp;
                                        </c:when>
                                        <c:otherwise>
                                            <input id="btnCancel" class="btn btn-primary" type="button" value="删除" style="background-color:red;" ></c:otherwise>
                                    </c:choose>
                                </div>
                        </div>

                    </form:form>
                    </center>
                </div>
            </div>
        </section>
    </div>
</div>

